<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    //65%
    var maximumProduct = function(nums) {
        nums.sort(function(a,b){
            return a-b;
        })
        const len = nums.length;
        return Math.max(nums[0]*nums[1]*nums[len-1],nums[len-1]*nums[len-2]*nums[len-3]);
    };
    let nums = [1,2,3];
    console.log(maximumProduct(nums));
</script>
</html>